<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="./index.css">
    <script src="./1-封装ajax.js"></script>

    
</head>
<body>
    <div class="box">
      <!-- 图片 -->
      <div class="img-box">
        <!-- 轮播图图片 -->
        <ul>
          <li></li>
        </ul>

        <!-- 轮播图箭头 -->
        <div class="arrow-left">&lt;</div>
        <div class="arrow-right">&gt;</div>
      </div>

      <!-- 小圆点 -->
      <div class="dot-box">
        <span class="dot-active"></span><span></span><span></span><span></span>
      </div>
    </div>
    <script>
        // https://service-dmsf9bxc-1251395798.gz.apigw.tencentcs.com/release/api/web/carouselGroup/getAllCarouselGroup?projectId=6
        let ul = document.querySelector('ul')
        let li = document.querySelector('li')
        const baseUrl = 'https://service-dmsf9bxc-1251395798.gz.apigw.tencentcs.com/release';
        ajaxFn({
            baseUrl,
            url: '/api/web/carouselGroup/getAllCarouselGroup',
            method: 'GET',
            data: {
                projectId: '6',
            },
            headers: {'Content-type': 'application/json; charset=UTF-8'},
            callBack: (res)=>{
                console.log(res);
                console.log(res.data.rows[0].w_carousels);
                let arr = res.data.rows[0].w_carousels;
                for(const key in arr){
                    console.log(key);
                    li.innerHTML += `<img src="${arr[key].url}" alt="">`;
                    console.log(li);
                };
            },
        });
        
    </script>
    <script src="./index.js"></script>
</body>
</html>